package parking;

/**
 * Class holding a counter on the number of cars entering or leaving the parking
 * @author Sophie and Ronnie
 * @date 9 November 2013
 */
public class CarManager {
	int nbCars; //number of cars inside the parking

	/**
	 * Constructor for the class
	 * @param nbCars : number of cars inside the parking (at initialization by the server, equals to 0)
	 */
	public CarManager(int nbCars) {
		this.nbCars = nbCars;
	}

	/**
	 * @return the actual number of cars inside the parking
	 */
	public int getNbCars() {
		return this.nbCars;
	}

	/**
	 * Method used to increase the number of cars when a car is entering the parking
	 */
	public void incNbCars() {
		this.nbCars++;
	}

	/**
	 * Method used to decrease the number of cars when a car is exiting the parking
	 */
	public void decNbCars() {
		this.nbCars--;
	}
}
